<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="format-detection" content="telephone=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <link href="css/SYSFrame.css" rel="stylesheet" type="text/css" />
    <link href="font/iconfont.css" rel="stylesheet" type="text/css" />
    <link href="css/module.css" rel="stylesheet" type="text/css" />
    <link href="css/pages.css" rel="stylesheet" type="text/css" />
    <title>个人信息</title>
    <script src="js/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script src="js/jquery.nicescroll.js" type="text/javascript"></script>
    <script src="js/HUpages.js" type="text/javascript"></script>
    <script src="js/common.js" type="text/javascript"></script>
    <script src="js/template.js" type="text/javascript"></script>
    <!--[if lt IE 9]>
    <script src="js/html5shiv.js" type="text/javascript"></script>
    <script src="js/css3-mediaqueries.js"  type="text/javascript"></script>
    <![endif]-->
</head>
<body id="pagestyle" class="backgrounddd">
<div class="bk-con-message message-section" id="iframe_box">
    <div class="box-module height100b margin0">
        <div class="box-title">个人信息</div>
        <div class="box-content padding15">
            <div class="Promp_plate btn-green "><b>提示：</b>如果你喜欢我的框架，不妨捐赠，无论金额大小，都非常感谢，同时也是对我努力的回报，同时会更好的完善框架。
                <span class="iconfont PrompClose">&#xe627</span>
            </div>
            <!--个人信息-->
            <div class="add_content clearfix mt15" >
                <div class="clearfix" id="user_details"></div>
                <div class="buttonstyle"><button type="button"  class="btn padding10 bg-deep-blue" onclick="modifybtn()">保存修改</button></div>
            </div>
        </div>
    </div>
</div>
</body>
</html>
<script id='userinfoHtml' type='text/html' >
    <% for(var i = 0; i < list.length; i++) { %>
    <% if(list[i].id==id){%>
    <ul class="info_list" id="VerifyTips">
        <li class="clearfix content_look mb15">
            <label class="label_name">用户头像：</label>
            <span class="info_data">
									<div class="gradeimg-style">
									<div class="Upload-screenshot">
									<img class="addImg" src="" onerror="this.src='images/zjbg_03.png',this.onerror=null">
									<input name="url" type="file" class="upload_input" accept="image/*">
									<input type="hidden" id="img" name="img">
									<div class="preBlock">
										<img class="preview" alt="" name="pic" onerror="this.src='images/zjbg_03.png',this.onerror=null">
									</div>
									<img class="delete" src="images/delete.png">
								</div>
							    </div>
								</span>
        </li>
        <li class=" clearfix content_look mb15">
            <label class="label_name"><em style="color:Red;">*</em>用户名：</label>
            <span class="info_data"><input data-name="用户名" type="text" value="<%=list[i].name%>" name="Required" class="text_input col-sm-4" data-verify="verify"/></span>
        </li>
        <li class=" clearfix content_look mb15">
            <label class="label_name">性别：</label>
            <span class="info_data">
			        			 <% if(list[i].sex==0){ %>
			        			 	<input data-name="性别" type="text" name=""value="保密" class="text_input col-sm-4" data-verify="verify"/>
			        			 	<% } else if(list[i].sex==1){ %>
			        			 	<input data-name="性别" type="text" name=""value="男" class="text_input col-sm-4" data-verify="verify"/>
			        			     <% } else if(list[i].sex==2) { %>
			        			 	<input data-name="性别" type="text" name=""value="女" class="text_input col-sm-4" data-verify="verify"/>
			        			 	<% } %>
			        			</span>
        </li>
        <li class=" clearfix content_look mb15">
            <label class="label_name">年龄：</label>
            <span class="info_data"><input data-name="年龄" type="text" name=""value="<%=list[i].age%>" class="text_input col-sm-4" data-verify="verify"/></span>
        </li>
        <li class=" clearfix content_look mb15">
            <label class="label_name"><em style="color:Red;">*</em>部门：</label>
            <span class="info_data"><input data-name="部门" name="Required" value="<%=list[i].department%>"  type="text"class="text_input col-sm-4" data-verify="verify"/></span>
        </li>
        <li class=" clearfix content_look mb15">
            <label class="label_name"><em style="color:Red;">*</em>职位：</label>
            <span class="info_data"><input data-name="职位" name="Required" value="<%=list[i].position%>" type="text"  class="text_input col-sm-4" data-verify="verify"/></span>
        </li>
        <li class=" clearfix content_look mb15">
            <label class="label_name">角色：</label>
            <span class="info_data">
			        			<% for(var j = 0; j < grade.length; j++) { %>
			        				<% if(list[i].grade==grade[j].id){ %>
			        			<input data-name="角色"  type="text"  class="text_input" value="<%=grade[j].name%>" readonly="readonly"/>
			        			<% } %>
			        			<% } %>
			        			<em style="color:#999999; margin-left: 10px;">该角色由最高权限管理员修改</em></span>
        </li>
        <li class=" clearfix content_look mb15">
            <label class="label_name"><em style="color:Red;">*</em>手机：</label>
            <span class="info_data"><input data-name="手机号码" name="Required" type="text" value="<%=list[i].Phone%>" class="text_input col-sm-4" value="" data-prompt="phone" data-verify="verify"/></span>
        </li>
        <li class=" clearfix content_look mb15">
            <label class="label_name"><em style="color:Red;">*</em>邮箱：</label>
            <span class="info_data"><input data-name="邮箱" name="Required" type="text" value="<%=list[i].mailbox%>" class="text_input col-sm-4" value="" data-prompt="mailbox" data-verify="verify"/></span>
        </li>
        <li class=" clearfix content_look mb15">
            <label class="label_name">说明：</label>
            <span class="info_data"><textarea data-name="说明" name="" class="form-textarea textarea-info" id="form_textarea" placeholder=""><%=list[i].content%></textarea>
			        			</span>
        </li>
    </ul>
    <% } %>
    <% } %>
</script>
<script>
    $(function() {
        $("#pagestyle").Hupage({
            scrollbar: function(e) {
                e.niceScroll({
                    cursorcolor: "#dddddd",
                    cursoropacitymax: 1,
                    touchbehavior: false,
                    cursorwidth: "3px",
                    cursorborder: "0",
                    cursorborderradius: "3px",
                });
            },
            expand: function(thisBox, settings) {
                settings.scrollbar(
                    $(".box-content").css({
                        height: $(window).height() - $('.box-title').outerHeight() - (settings.padding*2)
                    })); //设置当前页滚动样式
            }
        })
    });
    (function($) {
        $.getUrlParam = function(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if(r != null) return unescape(r[2]);
            return null;
        }
    })(jQuery); //设置url
    var userid = $.getUrlParam('userid');
    //编辑数据
    var userinfo = function(callback) {
        $.ajax({
            url: "json/userData.json",
            type: "GET",
            dataType: 'json',
            success: function(ret) {
                typeof callback == 'function' && callback(ret);
            },
        });
    };
    userinfo(function(listArr) {
        var listhtml = $('#user_details');
        var html = template('userinfoHtml', {
            id: userid,
            grade: listArr.grade,
            list: listArr.administrator
        });
        listhtml.html(html);
        $("#userinfoHtml").remove();
        var api="";//调用的api接口
        var type=1;//类型
        //调用图片上传
        imgUpload(api,type);
        //设置字数
        new Wordcount("form_textarea",200);
    });
    //提交操作

    function modifybtn(){

        new huprompt("VerifyTips");

    }
</script>

